Skip to content

Conversation

@Jean-Lessa
Copy link
Collaborator

@Jean-Lessa Jean-Lessa commented Jan 6, 2025

This PR is meant to concentrate efforts in improving SonarQube's code coverage analytics. Follow-up for #141 , this is the second pass (focused only mostly on uncovered conditions).

Here's what we have so far:

  • gcovr on the Actions workflow is now called with --exclude-throw-branches, which by itself upped overall coverage from 64.6% to a whopping 82.5%
  • Additional reviews of most tests and code logic fixes brought the percentage up to 85.3% (as of c59eb6d)
  • I haven't touched ContractHost due to the ongoing refactor, that's probably going to be its own thing maybe
  • Tests for the Blockchain class were updated (or rather "I tried to, at least they compile now") to reflect the actual code structure we have, but they're still commented out on CMakeLists because they're still failing due to who knows why (maybe I dun goofed there but I'm not sure) - technically if someone manages to fix that and reenable the tests we could bring coverage even further up as that's one of the lowest coverage percentages we have in SonarQube
  • Another big thing that could bring coverage up is both SnailTracer contracts - their tests do not run on the Actions workflow due to BUILD_BENCHMARK being OFF by default (so their coverage is literally 0%, as it is with the src/bins files as well) - I haven't turned them on because I don't know if that's gonna clog up the Actions workflow, but if it doesn't I would recommend doing that next just to see if percentage goes up
  • One thing I couldn't figure out yet is why SonarQube flags most of the contracts' registerContract() lines in the headers as partially covered (specifically the std::make_tuple initializations, check any of them) - I have no idea why that happens, but if we somehow find out, that could also bring coverage up in a significant amount

@Jean-Lessa Jean-Lessa merged commit 030c9e8 into development Jan 15, 2025
2 of 3 checks passed
@Jean-Lessa Jean-Lessa deleted the coverage branch January 15, 2025 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants